import React,{useState} from 'react'
import InputTag from './index'
export default function parent() {
  const [values, setValues] = useState(['TEXT'])
  const onChange = (data) => {
    if(typeof data === 'number'){
      const newValue = [...values]
      newValue.splice(data, 1)
      console.log(newValue)
      setValues(newValue)
    }else{
      setValues([...values, ...data])
    }  
  }
  return (
    <div>
      <InputTag values={values} onChange={onChange}/>
    </div>
  )
}
